
#ifndef _BOOKINGRECORD_H_20111127
#define _BOOKINGRECORD_H_20111127

#include "Record.h"

namespace AirlineRes
{

/// Class to store and operate upon the data that comprises a booking.
class BookingRecord : public Record
{
public:

  /// Represents possible states for a booking.
  enum BookingStatus
  {
    BookingStatus_Confirmed,
    BookingStatus_Reserved,
	BookingStatus_Cancelled,
    BookingStatus_NumBookingStatuses
  };

  /// Represents possible classes for a booking.
  enum BookingClass
  {
    BookingClass_First,
    BookingClass_Economy,
    BookingClass_NumBookingClasses
  };

  BookingRecord(){};
  ~BookingRecord(){};

  /// Construct record initialised with field values.
  BookingRecord
    (
      int m_flightID,
      int m_customerID,
      BookingStatus m_status,
      BookingClass  m_class
    );

  virtual RecordIOResult LoadRecord( std::istream& _stream );
  virtual RecordIOResult WriteRecord( std::ostream& _stream ) const;

  // Getters
  /// Get the ID of the flight record that this booking references.
  inline int GetFlightID() const { return m_flightID; };
  /// Get the ID of the customer record that this booking references.
  inline int GetCustomerID() const { return m_customerID; };
  /// Get the status of the customer record that this booking references.
  inline BookingStatus GetBookingStatus() const { return m_status; };
  /// Get the class of the customer record that this booking references.
  inline BookingClass GetBookingClass() const { return m_class; };

  // Setters
  /// Set the ID of the flight record that this booking references.
  inline int SetFlightID( int _flightID )   { m_flightID   = _flightID;   };
  /// Set the ID of the customer record that this booking references.
  inline int SetCustomerID( int _customerID ) { m_customerID = _customerID; };

    /// Set the BookingStatus of the Booking record.
  inline void SetBookingStatus(BookingStatus _BookingStatus)  { m_status  = _BookingStatus;};
private:
  int m_flightID;
  int m_customerID;
  BookingStatus m_status;
  BookingClass  m_class;
};

} // namespace AirlineRes

#endif _BOOKINGRECORD_H_20111127
